<template>
  <view class="item">
    <view class="left">
      <image :src="data.goods_small_logo || defaultImg" mode=""></image>
    </view>
    <view class="right">
      <view class="title">
        {{data.goods_name}}
      </view>
      <view class="price">
        ￥{{data.goods_price | toFixed}}
      </view>
    </view>

  </view>
</template>

<script>
  export default {
    name: "my_goods",
    props: {
      data: {},

    },
    filters:{
      toFixed(v){
        return v.toFixed(2)
      }
    },
    data() {
      return {
        // 处理不存在的图片
        defaultImg: 'https://img3.doubanio.com/f/movie/8dd0c794499fe925ae2ae89ee30cd225750457b4/pics/movie/celebrity-default-medium.png'
      };
    }
  }
</script>

<style lang="scss">
.item{
    display: flex;
    padding: 20rpx;
      font-size: 14px;
        border-bottom: 1px solid #f8f7f7;
    .left{
      image{
        width: 200rpx;
        height: 200rpx;
        margin-right: 20rpx;
      }
    }
    .right{
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      
      .price{
        color: #c00000;
      }
    }
  }
</style>
